#ifndef CONST_H
#define CONST_H
constexpr int MAP_SIZE  = 20;     //地图大小
constexpr int MAX_ROUND = 500;   //最大回合数

constexpr int TEAM1_POS_X = 17;
constexpr int TEAM1_POS_Y = 2;
constexpr int TEAM2_POS_X = 2;
constexpr int TEAM2_POS_Y = 17;

/************************************************
地图地形(1:可建造,2:不可建造)
************************************************/
const int MAP[MAP_SIZE][MAP_SIZE] =
{
    1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,
    1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,0,1,
    0,1,1,1,1,0,0,0,1,1,0,0,0,1,0,1,1,1,1,1,
    1,1,1,1,0,0,0,0,0,0,1,0,0,1,1,0,1,1,1,1,
    1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,0,1,1,1,
    1,1,1,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,1,
    1,1,1,1,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,0,
    1,1,1,1,0,0,1,0,0,1,1,0,1,0,0,0,1,0,0,0,
    1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,
    1,1,1,1,1,1,1,0,0,0,1,1,0,1,1,1,1,1,1,0,
    0,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,
    0,0,1,1,1,1,0,0,1,1,0,0,0,1,1,1,1,1,1,1,
    0,1,1,0,0,0,1,1,0,0,1,0,0,0,0,0,1,1,1,1,
    0,1,1,1,1,1,1,1,0,1,1,0,0,1,0,0,1,1,1,1,
    1,0,0,0,1,1,1,1,0,1,1,0,0,0,0,0,1,1,1,1,
    1,1,1,0,0,1,1,0,0,0,1,0,0,0,0,0,1,1,1,1,
    1,1,1,1,0,1,1,0,0,1,0,1,0,0,0,1,1,1,1,0,
    0,0,1,1,1,0,1,0,1,0,1,1,0,0,0,1,1,1,1,0,
    1,1,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
    1,1,0,1,1,0,1,1,0,1,1,1,0,1,1,0,1,1,0,1
};

/************************************************
地块的养分系数
************************************************/
const double ENERGY[MAP_SIZE][MAP_SIZE] =
{
    0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.34,0.34,0.55,0.55,0.55,0.60,0.73,0.73,
    0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.34,0.34,0.54,0.55,0.55,0.55,0.73,0.73,
    0.73,0.55,0.55,0.55,0.55,0.53,0.35,0.71,0.55,0.55,0.73,0.55,0.55,0.34,0.34,0.55,0.55,0.55,0.55,0.55,
    0.55,0.55,0.55,0.55,0.55,0.55,0.29,0.55,0.38,0.55,0.73,0.55,0.55,0.34,0.34,0.43,0.55,0.55,0.55,0.55,
    0.55,0.55,0.55,0.55,0.64,0.73,0.20,0.55,0.34,0.55,0.55,0.55,0.34,0.34,0.34,0.34,0.35,0.55,0.55,0.55,
    0.55,0.55,0.55,0.55,0.55,0.73,0.20,0.67,0.34,0.55,0.55,0.55,0.34,0.34,0.34,0.34,0.34,0.34,0.34,0.55,
    0.55,0.55,0.55,0.55,0.43,0.20,0.20,0.20,0.45,0.55,0.55,0.34,0.34,0.35,0.35,0.34,0.34,0.34,0.34,0.35,
    0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.20,0.40,0.55,0.55,0.35,0.35,0.35,0.53,0.51,0.55,0.34,0.34,0.55,
    0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.34,0.20,0.55,0.34,0.35,0.36,0.55,0.55,0.55,0.55,0.55,0.55,0.55,
    0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.50,0.29,0.27,0.34,0.34,0.54,0.55,0.55,0.55,0.55,0.55,0.55,0.55,
    0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.35,0.34,0.20,0.27,0.34,0.34,0.55,0.55,0.55,0.55,0.55,0.55,0.55,
    0.55,0.55,0.55,0.55,0.55,0.55,0.53,0.34,0.34,0.34,0.34,0.20,0.33,0.55,0.55,0.55,0.55,0.55,0.55,0.55,
    0.55,0.34,0.34,0.55,0.34,0.34,0.34,0.34,0.34,0.55,0.55,0.20,0.20,0.55,0.50,0.34,0.55,0.55,0.55,0.55,
    0.52,0.34,0.34,0.34,0.34,0.34,0.34,0.34,0.37,0.55,0.55,0.55,0.32,0.20,0.56,0.55,0.55,0.55,0.55,0.55,
    0.55,0.55,0.55,0.34,0.34,0.34,0.34,0.34,0.55,0.55,0.55,0.34,0.61,0.20,0.73,0.62,0.55,0.55,0.55,0.55,
    0.55,0.55,0.55,0.53,0.34,0.34,0.34,0.34,0.55,0.72,0.55,0.35,0.55,0.20,0.67,0.55,0.55,0.55,0.55,0.55,
    0.55,0.55,0.55,0.55,0.54,0.34,0.34,0.55,0.55,0.73,0.55,0.55,0.60,0.24,0.43,0.55,0.55,0.55,0.55,0.55,
    0.71,0.55,0.55,0.55,0.55,0.53,0.34,0.55,0.55,0.55,0.55,0.55,0.55,0.38,0.47,0.55,0.55,0.55,0.55,0.63,
    0.73,0.73,0.55,0.55,0.55,0.54,0.34,0.34,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,
    0.73,0.73,0.63,0.55,0.55,0.55,0.34,0.34,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.62,0.55
};

/************************************************
常用的枚举类型
************************************************/
namespace UnitTypeNamespace
{
	enum RobotType      { RawRobot, AttackRobot, DefenseRobot, GatherRobot };
	enum SkillType      { PlainAttackSkill, SplitSkill, RecoverSkill, ShieldingSkill, AirborneSkill, OverloadSkill, ScourgeSkill, BombingSkill, EvolveSkill, VestigialSkill, ConnectSkill, DisconnectSkill, TransferSkill};
	enum BuffType       { ScourgeBuff, OverloadHighBuff, OverloadLowBuff, ShieldingBuff, DecAttackBuff, AirborneSurge};
	enum EventType		{ LinkEvent, TriggeredDeathEvent, SpreadScourgeEvent, SkillCallEvent};
}
namespace OrderTypeNamespace
{
	enum OrderType      { PlainAttack, Split, Recover, Shielding, Airborne, Overload, Scourge, Bombing, Evolve, Vestigial, Connect, Disconnect, Transfer};
	enum HumanOrderType { Console, KeyDown, KeyUp, LeftMouseDown, LeftMouseUp, LeftMouseClick, RightMouseClick, LocalButtonClick, GlobalButtonClick};
	enum ShowInfoType   { ShowString, ShowCircle, PosFlash, SelectGrid, DeselectGrid, Surrender };
}
using namespace UnitTypeNamespace;
using namespace OrderTypeNamespace;

/************************************************
常用的字符串
************************************************/
namespace StringNamespace
{
	constexpr const char* RobotTypeString[] = { "Raw", "Attack", "Defense", "Gather" };
	constexpr const char* SkillTypeString[] = { "PlainAttack", "Split", "Recover", "Shielding", "Airborne", "Overload", "Scourge", "Bombing", "Evolve", "Vestigial", "Connect", "Disconnect", "Transfer" };
	constexpr const char* BuffTypeString[] = { "Scourge", "High", "Low", "Shielding", "DecAttack" };
	constexpr const char* OrderTypeString[] = { "PlainAttack", "Split", "Recover", "Shielding", "Airborne", "Overload", "Scourge", "Bombing", "Evolve", "Vestigial", "Connect", "Disconnect", "Transfer" };
	constexpr const char* HumanOrderTypeString[] = { "Console", "KeyBoard", "LeftMousePress", "LeftMouseRelease", "LeftMouseClick", "LeftMouseDoubleClick", "LocalButtonClick", "GlobalButtonClick", "HighLightChange" };
	constexpr const char* ShowInfoTypeString[] = { "ShowString", "ShowCircle", "RobotFlash", "Surrender", "SelectGrid", "DeselectGrid" };
	constexpr const char* ParamsDescription[] = {"<id>", "<x><y>", "<id>", "", "<x><y><energy>", "", "<id>", "<x><y>", "<type>", "<type>", "<id>", "<id>", "<id><energy>"};
}
using namespace StringNamespace;

enum TurnName{
	StartTurn,
	PreparationTurn,
	ProduceTurn,
	LinkTurn,
	TransferTurn,
	SetTransferTurn,
	EvolveTurn,
	StatsCalculationTurn,
	AuxiliaryTurn,
	BuffTurn,
	AttackTurn,
	AutoRecoveryTurn,
	DamageCalculationTurn,
	DeathCalculationTurn,
	DescendCoolDownTurn,
	EventTurn,
	TotalTurns,
};

constexpr int FixedSplitCost = 1000;//固定分裂花费
constexpr int FixedSplitPower = 300;//固定分裂能量
constexpr int SplitRange = 16;

constexpr int AirborneCD = 10;//空投CD
constexpr int FixedAirborneCost = 1000;//固定空投花费
constexpr int FixedAirbornePower = 750;//固定空投能量
constexpr double AirborneLost = 0.8;//空投能量损失
constexpr int AirborneTurn = 2;//空投延迟回合数

constexpr int LinkBuildTime = 2;//连接延迟回合数

constexpr int OverloadCost = 0;//过载花费
constexpr int OverloadCD = 10;//过载CD
constexpr int HighRank = 4;//过载正面效果持续时间
constexpr int LowRank = 10;//过载负面效果持续时间

constexpr int BombingRange = 36;//轰炸释放范围
constexpr int BombingRadius = 4;//轰炸伤害半径
constexpr int BombingCD = 10;//轰炸冷却时间
constexpr double BombingDamage = 3.0;//轰炸伤害系数
constexpr int ScourgeCD = 10;//天灾冷却时间
constexpr int ScourgeTimer = 3;//天灾多少回合传播一次
constexpr double ScourgeDamage = 1.0;//天灾伤害系数
constexpr int ScourgeHurtCD = 1;//天灾多少回合伤害一次
constexpr int ScourgeRemainTime = 7;//天灾持续时间

constexpr double RecoverMaxHPRate = 0.15;//回复血量百分比
constexpr int RecoverCost = 0;//回复花费
constexpr int RecoverCD = 3;//回复CD

constexpr int ShieldingRadius = 8;//庇护范围
constexpr int ShieldingCD = 10;//庇护CD
constexpr int ShieldingLast = 5;
constexpr int ShieldingCost = 0;//庇护花费
constexpr double DefenseShareRate = 0.3;//庇护带来的防御值提升效果比例
constexpr double AttackRate = 0.8;//庇护带来的攻击力下降效果

constexpr int RobotTypeNum = 3;//植物种类数

constexpr int GatherRange = 4;//最大采集距离
constexpr double RecoveryHPRate = 0.01;//HP自动恢复倍率
constexpr double WitherHPRate = -0.05;//HP自动消耗倍率
constexpr double baseEnergy = 10000;//初始能量

constexpr int levelBias = 5;//等级偏移
constexpr double BaseAttack = 15;//攻击力系数
constexpr double AttackExp = 1.7;//攻击力指数
constexpr double BaseHP = 500;//HP系数
constexpr double HPExp = 1.0;//HP指数
constexpr double BaseDefense = 10;//防御系数
constexpr double DefenseExp = 0.7;//防御指数
constexpr double BaseConsumption = 0.5;//消耗系数
constexpr double ConsumptionExp = 2.25;//消耗系数
constexpr double BaseEfficiency = 1;//采集系数
constexpr double EfficiencyExp = 1.25;//采集指数

constexpr double defenseBaseValue = 20;//防御公式基础
constexpr double VestigialLost = 0.5;//退化损失


#endif // CONST_H
